
const redis = require('redis')
 
const redisClient = redis.createClient({
  url: 'redis://127.0.0.1:6379'
})
 
redisClient.on('error', (err) => {
  console.log('Redis redisClient Error', err)
})
 
const init = async () => {
  // redisClient.on('connect', function() {
  //   console.log('Redis client connected');
  // });
 
  await redisClient.connect()
}
 
init()
 
module.exports = {
  redisClient,
  redistInit: init
}